package com.hxd.otc.module.convenience.adapter;

import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.hxd.otc.R;
import com.hxd.otc.module.convenience.bean.NorGoodsBean;
import com.hxd.otc.module.convenience.bean.RefuelingServiceBean;
import com.hxd.otc.utils.GlideUtils;
import com.hxd.otc.utils.UIUtils;

/**
 * 包  名 :  com.hxd.otc.module.convenience.adapter
 * 类  名 :  RefuelingServiceAdapter
 * 作  者 :  zjl
 * 时  间 :  2018/12/13 11:21
 * 描  述 :  ${TODO}
 */
public class HydropwerListAdapter extends BaseQuickAdapter<NorGoodsBean, BaseViewHolder> {

    public HydropwerListAdapter() {
        super(R.layout.adapter_hydropwer_list, null);
    }

    @Override
    protected void convert(BaseViewHolder helper, NorGoodsBean item) {

        if (item.getModuleCode().equals("c2670")) {
            helper.getView(R.id.rl_bg).setBackgroundResource(R.mipmap.water_card_bg);
        } else {
            helper.getView(R.id.rl_bg).setBackgroundResource(R.mipmap.lectric_card_bg);
        }
        helper.setText(R.id.tv_content, item.getGoodsName());
        GlideUtils.loadNormal(UIUtils.getContext(), UIUtils.getServiceImageUrlByPath(item.getGoodsIcon()), (ImageView) helper.getView(R.id.iv_icon));
    }
}
